package com.adingxiong.cft.constant;

public enum DateFormatEnum {
    YEAR_MONTH("ym","yyyy-MM"),

    YEAR_MONTH_DAY("ymd","yyyy-MM-dd"),

    WEEK("week","EEEE"),

    YEAR_MONTH_DAY_TIME("ymdh","yyyy-MM-dd hh:mm:ss");



    public static String getSDF(String msg){
        for(DateFormatEnum dateFormatEnum : DateFormatEnum.values()){
            if (dateFormatEnum.msg.equals(msg)) {
                return dateFormatEnum.sdf;
            }
        }
        return null;
    }

    private String msg;

    private String sdf;

    public String getMsg() {
        return msg;
    }

    public String getSdf() {
        return sdf;
    }

    private DateFormatEnum(String msg ,String sdf){
        this.msg = msg;
        this.sdf = sdf;
    }
}
